home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / demo2.zoo / demo / ex / TODO / text0004.txt < prev   
Encoding:
Text File  |  1984-06-11  |  20.0 KB  |  405 lines

  1. Latest letter to Mark Horton re editor bugs etc.:
  2.  
  3. copies sent to
  4. cc-03@ucbcory
  5. ralph@ucbarpa, lindahl@topaz, mckusick@ucbernie 25/7/83
  6. danh@kim  26/7
  7. Mark Horton's reply: anderson@kim 30/7/83
  8.  
  9. Dear Mark,
  10.      I got your reply to my last letter, but you don't say
  11. whether you got the two preceding ones -- in particular, I'm
  12. curious as to what you'd say about the peculiar behavior of
  13. abbreviations terminated by \[character].  (E.g., suppose
  14. someone did :ab ac artistic, and then, supposing the file was for
  15. troffing, typed ac\fP. -- Try it!)  And likewise, about what
  16. happens if you hit  @x,  when register  "x  contains
  17.     x:g/foo/s//bar
  18. (To see this wierd effect, you have to have a file with
  19. an occurrence of ``foo'', and a distinctive  l a s t  line.)
  20.  
  21.      In an earlier letter I commented that the mapping that
  22. the editor sets up to enable the tvi's right-arrow key makes
  23. ^L unavailable for refreshing the screen.  You replied that,
  24. of course, the editor could not distinguish a ^L generated by
  25. the arrow key from one typed as <ctrl>-L by the user.  True,
  26. but some users, such as myself, are quite happy using hjkl
  27. to move around the screen (I use them completely by reflex)
  28. and so have no wish to enable special arrow keys, but do
  29. want to have ^L available to redraw the screen when
  30. a message or something messes it up.
  31.      The problem with ^L occurred in using a tvi; now, using
  32. a Z29 (in h19 mode), another version of the problem arises.
  33. It has arrow keys that transmit things like ^]A, ^]B, etc.,
  34. and version 3.9 not only maps these sequences, but also
  35. map!s them.  What I found happening is that if in typing
  36. I made a change somewhere in the body of a line and then
  37. wanted to add something at the end of the line, I would often
  38. type a  ^]  to end the first change and then an  A  to
  39. begin the second, with less than a second between them, and
  40. this sequence would then be map!ed into  ^]ka  or
  41. something, landing me in a different place from the one
  42. I wanted.  Aside from this major problem, there is the minor
  43. inconvenience that the  map!  mechanism apparently waits
  44. a second every time I type an  ^]  from insert mode to see
  45. whether this is going to be one of the map!ed sequences, and
  46. this makes exiting from insert mode sluggish.  My temporary
  47. solution has been to write a file of the form
  48.     unmap ^]A| unmap ^]B| ...|unmap! ^]A| unmap! ^]B| 
  49. which I source every time I go into vi on the Z29.  I
  50. guess what I should do is create simplified termcaps that
  51. leave out the arrow keys for my own use when in version 3.7.
  52. Kevin Layer tells me that when he puts 3.9 on all systems here,
  53. there will be documentation on how to create terminfo files;
  54. so I will be able to avoid these inconveniences in 3.9 as well.
  55.      What would be better, for these two-or-more character sequences,
  56. though, would be if the "timeout" feature on mappings
  57. could involve a variable interval, which could be set in the
  58. millisecond range for terminal-generated sequences (I suppose
  59. it would have to depend on the baud rate), and longer
  60. for user-mapped sequences.  The likelihood of the user
  61. accidentally typing in one of the special sequences so fast
  62. is negligible.
  63.      Incidentally, I notice that when I type :map  to look
  64. at the automatic mappings, these are labeled "up", "down" etc.,
  65. though for mappings that I create the corresponding position
  66. just shows a repeat of the mapped sequence.  Is there
  67. any way the user can put mnemonics in with his own mappings?
  68.  
  69.      Two other minor points:
  70.  
  71.      In your reply to my first letter, where I suggested that
  72. N/pattern should take one to the Nth occurrence of /pattern,
  73. you said that N/pattern actually resets the window size to N
  74. while carrying one to /pattern.  The tutorial says the same,
  75. I believe, but nonetheless, it doesn't work!
  76.      When one has pulled a command into a buffer,
  77. say "x, and invoked it with @x, if one then tries to get
  78. a copy of this command by doing "xp, it doesn't seem to work.
  79. The way I've found to make it work is to do any other
  80. yank-and-put (using, say, the last-deleted
  81. buffer).  This somehow unfreezes the mechanism, and (after undoing
  82. this last put, unless one wanted it), one can then successfully
  83. do "xp.
  84.                 Yours,
  85.                     George
  86.  
  87. (Message inbox:32)
  88. Date: Sun, 10 Jun 84 16:29:50 pdt
  89. From: gbergman@ucbcartan (George Mark Bergman)
  90. To: cc-03@ucbcory, danh@kim, decvax!tarsa, gbergman@ucbcartan,
  91.         hplabs!intelca!omsvax!isosvax!root, ihnp4!burl!we13!ltuxa!jab,
  92.         leblanc@ucbdali, lindahl@topaz, mckusick@ucbernie, priili@Ardc.ARPA,
  93.         ralph@ucbarpa, reiser@ruby, romine@seismo.ARPA, unisoft!eryk,
  94.         uw-beaver!ubc-vision!mprvaxa!sonnens
  95. Subject: more editor bugs & ideas
  96.  
  97.      Here's another letter of comments on the editor that I'm
  98. sending to Mark Horton (mark@cbosgd).
  99.      If any of you to whom I'm sending this aren't interested in
  100. staying on this mailing list, just let me know.
  101.      Horton replied to an earlier letter by saying he had no idea
  102. when he'd have any time to work on the editor again, so I don't
  103. expect replies from him to this and further such letters in the near
  104. future.
  105.      For those who are not familiar with the subject of item "A."
  106. below, modeline is a feature that he added without publicizing it much,
  107. whereby if any line in the vicinity of the top or bottom of the file
  108. (top and bottom 10 lines?  I don't remember) contains the string
  109. vi: or ex: and then another :, everything between these is
  110. interpreted as a command and executed when this file is read by the
  111. editor.  There was a big squall in net.news when someone discovered
  112. it by chance (an accidental string of this sort occurred in their
  113. /etc/password; fortunately the "command" was meaningless, and evoked
  114. a diagnostic from the editor).  Some serious dangers of this
  115. feature were pointed out by various contributors, one of whom described
  116. for all who were interested how to eliminate it from the source file.
  117.  
  118. Dear Mark,
  119.      Here's another few month's collection of comments...
  120.  
  121. A.  Modeline
  122.      I presume that in following the net.news discussion of the
  123. ``MAJOR BUG (modeline)'' you saw my two contributions; but I'll
  124. summarize the relevant points (not in the order I made them):
  125.  
  126. 1)  One possible feature that would be about as convenient as
  127. the modeline, and would avoid the dangers that people have pointed
  128. out, would be `enhanced tags', in which the 3d entry of a line of the
  129. tags file could be not merely a pattern search, but an arbitrary
  130. command line.
  131.  
  132. 2)  I described (both in net.news and in an earlier letter to you) a
  133. mapping in my EXINIT which makes one keystroke yank the current line
  134. (or the next N lines if preceded by a count) to a named buffer
  135. and then execute that buffer.  If one keeps a set of initializing
  136. commands within a file to which they are to apply, one can then
  137. easily execute them on beginning an editing session, which gives
  138. almost the convenience of the modeline feature, without the dangers,
  139. and has an enormous range of other uses.  So I think the modeline
  140. feature could be dropped.
  141.  
  142.      Let me add to those points:
  143.  
  144. 3)  A modeline
  145.     vi:r %:
  146. leads to an infinite recursion!  Fortunately, ^C cuts it off.
  147.  
  148. 4)  I agree with others' comments in net.news that if the modeline
  149. feature is not dropped altogether, it should be a settable option
  150. with default ``nomodeline''.
  151.  
  152. 5)  It should certainly be off when ``novice'' is set!
  153.  
  154. B.  Tags
  155.      Having mentioned these in point A(1), I will give some other
  156. comments I have:  One of your update documents mentions the fixing
  157. of a bug that left ``nomagic'' set if the file named in the tags
  158. file did not exist.  Very good, but one still ends up with ``nomagic''
  159. if the file exists but the pattern-search is unsuccessful!
  160.      It would also be nice if the tags file could include file addresses
  161. of the form ~user/filename, in particular ~/filename, and if the
  162. command :set tags= recognized the same.  (I suppose this makes no
  163. difference to people who get their tags from ctags, but for me, the
  164. tags file is maintained as a collection of items I have been working on
  165. recently, or mean to soon, and entries are put in or removed by
  166. hand regularly.)
  167.  
  168. C.  Reversal of n and N
  169.      I also mentioned in one of my net.news comments a peculiar behavior
  170. that often seems to occur after I've been using my yank-and-execute
  171. mapping a lot, in which, after a command-line pattern-search :/pattern
  172. (rather than simply /pattern), the screen-mode commands n and N give
  173. searches in the reverse of the expected direction, with ? and /
  174. respectively instead of vice versa.  Perhaps you can figure out what
  175. causes this; if not, would it help for me to do something like make
  176. a core dump of the editor when it is happening and send it to you?
  177. (I don't know how to send a nonascii file, though... .)
  178.      A few more observations on this behavior:  Though I commonly
  179. discover it when I am using my yank-and-execute mapping, it has
  180. happened on at least one occasion when I hadn't use that at all,
  181. so far as I could recall.  It may actually happen quite frequently,
  182. but people just don't notice it because they usually use /pattern
  183. instead of :/pattern.  (My mapping makes it more convenient for
  184. me to use the latter when the pattern is complicated, or I want to
  185. store it for repeated use.)
  186.  
  187. D.  Update on dangerous recursions
  188.      Discovering that ^C interrupted the recursive modeline led me
  189. to test it out on a recursive mapping, :ab x ( x ).  It interrupts
  190. it OK.  Problem solved courtesy of 4.2BSD, I guess.
  191.  
  192.      I will collect under the next heading my usual list of:
  193.  
  194. E.  Minor bugs and modest suggestions
  195.  
  196.      ye and yE yank one character less than they should.
  197.  
  198.      If the command Ne (N a count) would land one on a 1-letter
  199. word, one generally lands at the end of the next word instead
  200. (even if it is also a 1-letter word.  Exception: if one starts
  201. at or after the end of the preceding word, e behaves as it should.)
  202.  
  203.      Note also that in the line
  204.     Sentence... .  Sentence
  205. if the cursor is on the second S, the command ( causes no motion
  206. at all.
  207.  
  208.      I suggest that the motion commands { and } should accept indented
  209. lines as paragraph-starts, or at least that there should be some
  210. way of requesting this in the ":set para=" command.  After all, these
  211. motions shouldn't be useful only to people writing troff files!
  212.  
  213.      In general, the command NC (where N is a count) changes material
  214. from the cursor position to the end of the Nth line, leaving material
  215. before the cursor on the current line unchanged.  But if the line
  216. is indented, and the cursor is on or before the first nonwhite
  217. character, the preceding white text (spaces and tabs) is lost.
  218.  
  219.      It should be possible to use
  220.     :unmap #1    :unmap! #1    :unab #1
  221. when function-keys have been mapped.
  222.  
  223.      Sometimes a noisy phone-line, termcap padding errors, etc.
  224. cause just one or two lines of the screen to be messed up, and one
  225. may only wish to refresh those lines.  Could a command be introduced
  226. which would do this?  Ironically, on a dumb terminal one can generally
  227. do this by moving the cursor over the line, but not on a smart terminal.
  228. Another way one can do it is ddP, but I would sometimes feel uneasy
  229. about unnecessarily modifying the text.  I would
  230. suggest that the form of the command be 1^L (2^L for 2 lines, etc.).
  231. Currently, ^L apparently ignores counts.  (Actually, I'm writing at
  232. the moment on a tvi, so I've verified this for ^R rather than ^L.)
  233.  
  234.      If one uses the source command, and the file sourced contains
  235. a command
  236.     :e newfile
  237. where newfile does not already exist, the diagnostic ``No such file
  238. or directory'' aborts the sourcing process.  One ought to be able to
  239. use such commands in a sourced file.
  240.  
  241.      In vi screen command mode, ^[ is supposed to ``cancel partially
  242. formed commands'' and generally does so without protesting, but if the
  243. partially formed command is a count (e.g., if one has typed 110 instead
  244. of 10 and wishes to start over) it feeps, which depending on one's
  245. terminal can be a minor or a major annoyance.  (Also depending on
  246. whether someone is trying to sleep in the next room.)
  247.  
  248.      The diagnostic, ``First address exceeds second'' should not be
  249. needed with one-address commands!  The case where a series of addresses
  250. before a command, of which the first may exceed the second, is most
  251. useful is when the last address is a pattern-search preceded
  252. by a ";", e.g.
  253.     :$;?^\.PP?-r otherfile
  254. but let me give simpler examples; of the two commands
  255.     :3,1,2ka    :1,3,2ka
  256. the first correctly marks line 2, but the second is aborted by the
  257. diagnostic quoted.
  258.  
  259. F.  A feature that would be very desirable, and might or might not
  260. be easy to implement.
  261.  
  262.      In general, when one is inserting text on a smart terminal in vi,
  263. the context below the text being added is pushed downward, line by line,
  264. till none is left on the screen.  I would like a settable option that
  265. kept a certain number of lines of following context on the screen
  266. during additions.  The point is that one should see the material that
  267. what one is writing will have to mesh with.  What would be involved in
  268. implementing this would, of course, depend on terminal capabilities.
  269. If it would be difficult to keep an arbitrary number of lines,
  270. would it at least be possible to have an option that would keep one
  271. line, using the special bottom-line feature of some terminals?
  272.  
  273. G.  More radical suggestions (wishlist).
  274.  
  275. 1)  Editing text with _✓u_✓n_✓d_✓e_✓r_✓l_✓i_✓n_✓i_✓n_✓g.
  276.      Although one of the valuable features of vi is the explicitness
  277. with which most nonprinting characters are shown, this can be annoying
  278. when one wants to deal with text in which many characters
  279. are ``emphasized'' using the sequence _^H; e.g. nroff output.  I
  280. suggest a settable option under which such sequences would be shown as
  281. with ul.
  282.      I realize that this would involve working out a great number
  283. of details, e.g. would motion commands treat _^Hx as one
  284. character or as three?  How would the nth column be defined?  How
  285. would one place the cursor on one of the elements of the string
  286. _^Hx for editing purposes?  What would be done with _^H^A or _^H_^H....?
  287.      I think the best solution would be to treat _^Hx as a single
  288. character for the purposes of motion commands, definition of nth
  289. column, deletions, etc. when this option was set.  In terms of placing
  290. the cursor, two possibilities occur to me.  One would be to only allow
  291. the cursor to sit on the underlined character ``as a whole'', and to
  292. have changes in underlining done by special commands: perhaps ^E as a
  293. toggle to turn emphasis on and off in insert mode, _ to change
  294. underlining in screen command mode as ~ changes capitalization
  295. ("_" is at present a synonym to "^", except
  296. that it takes counts.  ^ could be modified to take
  297. counts, and _ then used as suggested above), and \e in replacement
  298. patterns.  The other would be to consider a cursor sitting ``on''
  299. a sequence _^Hx to actually be on the x, and to set things up so that
  300. if the cursor is on any of the other members of this sequence, the
  301. sequence is ``expanded'' on the screen, i.e. shown as it is in the
  302. present vi.  Then define a single vi command so as not to skip over
  303. the _ and ^H in such a sequence; namely ^H.  (This would mean
  304. making a distinction between h and ^H in screen command mode.)
  305. This one motion would allow one to edit parts of such a sequence.
  306.  
  307. 2)  Editing several files at once.
  308.      When I have to do work that involves more than one file, the
  309. repeated use of :w|e#, yanking text to named buffers to move it, losing
  310. marked lines when I return to a previous file, etc.  becomes
  311. annoying.  I think it would be desirable if one could make a group
  312. of files behave like one file during an editing session, and move
  313. around within that file as comfortably as one move within one file.
  314.      I suggest that visually, each file be separated from the next
  315. by a pattern
  316. :::::::::::::::::::
  317. as when ``more'' is applied to a group of files.
  318. For ``Go to file 3, line 20'' I suggest a screen command syntax
  319. *3*20G.  *-1* and *+2* could mean ``the preceding file'' and ``the
  320. file after next'' in such commands.  (The initial * could be optional
  321. if there is no preceding + or -, as in the first example.)  In a
  322. command such as :w, the default address range would be all of the file
  323. to which the current line belongs (i.e.,
  324. it would be a synonym for :*.*w)  To write all files, I suggest :**w.
  325. :q, :x and ZZ would quit the editing session entirely, while :*1*q
  326. would remove the buffer of file 1 from the object being edited.
  327. On the other hand, relative motions such as 10j, H, etc. would work
  328. within the ``visible object'', the union of the files.
  329. %s/pattern/repl/ would apply to the file containing the current line,
  330. and would have the synonym *.*s/pattern/repl/, while
  331. *1,2,4*s/pattern/repl/ would affect the 3 indicated files, and
  332. **s/pattern/repl/ would affect all files.
  333.  
  334. 3)  Input and output of shell escapes.
  335.      The various commands involving shell escapes that you have
  336. set up allow four possible relations between the text being edited
  337. and the input and output of the commands: none (:!command);
  338. specified line-range as input with output not affecting text
  339. (:address-range w !command); no input from text but output inserted at
  340. specified line (:address r !command); and specified input from text
  341. with output replacing input (:address-range !command).
  342.      It would be nice to have more flexibility; in particular, to
  343. be able to include input from the file and place the output somewhere
  344. else in the file without destroying the input text, and to input
  345. more than one segment of text, e.g.
  346.     !egrep -f[addr.range] [other.addr.range] > [place of insertion]
  347. Obviously, there would be a problem of setting up a syntax that would
  348. avoid confusion with strings that look like address-ranges in the
  349. shell command.  Perhaps \[...\] could enclose address-ranges where
  350. I have used [...] above.
  351.  
  352. 4)  ;
  353.     The ; syntax, allowing one to do a pattern-search starting
  354. from a specified line is useful, but in setting up 2-address commands,
  355. one does not necessarily want the point from which one starts the
  356. search for the second address to be the first address.  If this business
  357. were being set up now, I would suggest that
  358.     address;/pattern/
  359. should simply be a way of specifying the result of doing the indicated
  360. pattern-search relative to the indicated address, so that
  361.     :address1,address2;/pattern/d
  362. would delete from address1 to the location found by the pattern-search
  363. relative to address2.  Since people are used to the existing
  364. syntax of ;, I suggest that some other symbol be used in the above
  365. way, e.g. ], so that
  366.     :address1,address2]/pattern/d
  367. could be interpreted as described.
  368.  
  369. 5) Insertions into long lines on smart terminals at low or medium
  370. baud rate (e.g. 1200).
  371.      This is annoying because the material coming after the point
  372. of insertion begins to wrap around, and the cursor must jump back and
  373. forth, inserting characters at the beginning of the
  374. continuation line, then going back to the point of insertion, and so
  375. on.  (At least, this is my experience on my Z29.  I haven't done
  376. editing by phone connection on any other smart terminal.)  It's
  377. actually nicer on a dumb terminal, where the editor just overwrites,
  378. and shows you the result after you escape.  I suppose that the need
  379. for the cursor to jump back and forth is due to the deficiency of the
  380. terminals -- has anyone suggested to terminal manufacturers that along
  381. with the wraparound feature, they add a feature which ``remembers''
  382. when a line is a continuation of the preceding line, and automatically
  383. pushes material from the preceding line into the continuation line
  384. when characters are added to the former, eliminating the need to send
  385. all these instructions in over a slow line?  (Do terminal manufacturers
  386. listen to editor-software specialists?)  If not, it might just
  387. be best to not show the pushed-over earlier material till the insertion
  388. is complete.
  389.  
  390. 6)  Filename convention
  391.      This is really a suggestion for UNIX generally, but it could be
  392. implemented on the editor separately.  It is that for any file,
  393. filename/.. denote the directory in which the file lies.  (This
  394. does not mean that every file should be treated as a directory, or
  395. that the ls command should show filename/..; it would just
  396. be a convenient way to refer to the directory containing a given
  397. nondirectory file, consistent with the existing convention for
  398. directories.)  Within the editor, the important cases would be
  399. %/.. and #/.., allowing commands such as:
  400.     :1,10w %/../othername
  401.  
  402.             All for now! Yours,
  403.                 George
  404.  
  405.